package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemediaCilent;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: xrl
 * @Date: 2022/10/22  18:30
 * @Version 1.0
 * 审核自媒体文章
 */
@RestController
@RequestMapping("/api/v1/news")
public class NewsController {

    @Autowired
    private IWemediaCilent wemediaCilent;

    /**
     * 查询文章列表
     */
    @PostMapping("/list_vo")
    public ResponseResult news_List(@RequestBody NewsAuthDto dto) {
        return wemediaCilent.news_List(dto);
    }


    /**
     * 查询文章详情
     */
    @GetMapping("/one_vo/{id}")
    public ResponseResult news_ById(@PathVariable("id") Integer id) {
        return wemediaCilent.news_ById(id);
    }

    /**
     * 审核失败
     */
    @PostMapping("/auth_fail")
    public ResponseResult auth_Fail(@RequestBody NewsAuthDto dto) {
        return wemediaCilent.auth_Fail(dto);
    }

    /**
     * 审核成功
     */
    @PostMapping("/auth_pass")
    public ResponseResult auth_Pass(@RequestBody NewsAuthDto dto) {
        return wemediaCilent.auth_Pass(dto);
    }
}
